package com.s3.khospitalds.controller;

import com.s3.khospitalds.entity.Department;
import com.s3.khospitalds.service.DepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author: rsh
 * @CreateTime: 2025/3/28
 * @Description: 用户
 * @Version: 1.0
 */
@RestController
@CrossOrigin(origins = "*")
public class DepartmentController {
    @Autowired
    private DepartmentService departmentService;

    @GetMapping("/getAllDepartment")
    public Object getAllDepartment() {
        return departmentService.getDepartment();
    }

    @GetMapping("/getDepartment")
    public List<Department> getDepartment() {
        return departmentService.getDepartment();
    }
}
